package com.yanggu.scala.chapater10;

import java.util.ArrayList;

/**
 * @version V1.0
 * @author: YangGu
 * @date: 2020/7/7 11:15
 * @description:
 */
public class JavaCollection {

    public static void main(String[] args) {
        //不可变的集合类似java的数组
        int[] nums = new int[3];
        nums[2] = 11;
        nums[2] = 22;
        //nums[3] = 44;

        //可变集合
        ArrayList<String> list = new ArrayList<String>();
        list.add("张三");
        list.add("王五");
        list.add("王五");
        System.out.println(list + " " + list.hashCode());
        list.add("王五");
        list.add("王五");
        System.out.println(list + " " + list.hashCode());

    }

}
